package com.design.oop.util;

import android.content.Context;
import android.widget.Toast;

public class NToast {
	public static void showToast(Toast toast, Context ctx, String message, boolean isShort) {
		if (toast == null) {
			toast = Toast.makeText(ctx, message, isShort ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG);
		} else {
			toast.setText(message);
			toast.setDuration(isShort ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG);
		}

		toast.show();
	}
}
